//
//  AttendanceDynamicCellConstraintFactory.m
//  RSW.IOS
//
//  Created by zhaiqiuqiu on 17/1/3.
//  Copyright © 2017年 com.xtion.crm. All rights reserved.
//

#import "AttendanceDynamicCellConstraintFactory.h"

@implementation AttendanceDynamicCellConstraintFactory

+(XMSQueueDictionary*)factoryForModify:(ExpandInfo*)expandInfo
{
    return [[AttendanceDynamicCellConstraintFactory new] factoryForModify:expandInfo];
}

+(XMSQueueDictionary*)factoryForReview:(ExpandInfo*)expandInfo
{
    return [[AttendanceDynamicCellConstraintFactory new] factoryForReview:expandInfo];
}

-(XMSQueueDictionary*)originConstraint
{
    XMSQueueDictionary *tmp = [XMSQueueDictionary new];
    
    [tmp addKey:@"基本信息" value:[NSMutableArray arrayWithObjects:
                               [self type],[self content],[self address], [self latitude], [self longitude], [self images], nil]];
    
    return tmp;
}

-(XMSQueueDictionary*)factoryForModify:(ExpandInfo*)expandInfo
{
    return [self factoryForModify:expandInfo originConstraint:[self originConstraint]];
}

-(XMSQueueDictionary*)factoryForReview:(ExpandInfo*)expandInfo
{
    return [self factoryForReview:expandInfo originConstraint:[self originConstraint]];
}


-(FieldDescript*)type
{
    FieldDescript *fix = [FieldDescript new];
    fix.controlType = [XMSNumberInt numberIntWithIntValue:DynamicFieldControlTypeSwitchSelect];
    fix.entityRegID = @"";
    fix.expandFieldID = @"";
    fix.fieldLabel = @"考勤类型";
    fix.fieldLength = [XMSNumberInt numberIntWithIntValue:50];
    fix.fieldName = @"TypeId";
    fix.fieldType = [XMSNumberInt numberIntWithIntValue:DynamicFieldTypeSystem];
    fix.isAllowEmpty = [XMSNumberInt numberIntWithIntValue:0];
    fix.isReadOnly = [XMSNumberInt numberIntWithIntValue:0];
    fix.optional = @"";
    fix.order = [XMSNumberInt numberIntWithIntValue:0];
    fix.regx = @"";
    fix.status = nil;
    fix.optIsVisible = [XMSNumberInt numberIntWithIntValue:1];
    fix.viewIsVisible = [XMSNumberInt numberIntWithIntValue:1];
    return fix;
}

-(FieldDescript*)content
{
    FieldDescript *fix = [FieldDescript new];
    fix.controlType = [XMSNumberInt numberIntWithIntValue:DynamicFieldControlTypeBigText];
    fix.entityRegID = @"";
    fix.expandFieldID = @"";
    fix.fieldLabel = @"内容";
    fix.fieldLength = [XMSNumberInt numberIntWithIntValue:500];
    fix.fieldName = @"Content";
    fix.fieldType = [XMSNumberInt numberIntWithIntValue:DynamicFieldTypeSystem];
    fix.isAllowEmpty = [XMSNumberInt numberIntWithIntValue:0];
    fix.isReadOnly = [XMSNumberInt numberIntWithIntValue:0];
    fix.optional = @"";
    fix.order = [XMSNumberInt numberIntWithIntValue:1];
    fix.regx = @"";
    fix.status = nil;
    fix.optIsVisible = [XMSNumberInt numberIntWithIntValue:1];
    fix.viewIsVisible = [XMSNumberInt numberIntWithIntValue:1];
    return fix;
}

-(FieldDescript*)address
{
    FieldDescript *fix = [FieldDescript new];
    fix.controlType = [XMSNumberInt numberIntWithIntValue:DynamicFieldControlTypeText];
    fix.entityRegID = @"";
    fix.expandFieldID = @"";
    fix.fieldLabel = @"地址";
    fix.fieldLength = [XMSNumberInt numberIntWithIntValue:50];
    fix.fieldName = @"Address";
    fix.fieldType = [XMSNumberInt numberIntWithIntValue:DynamicFieldTypeSystem];
    fix.isAllowEmpty = [XMSNumberInt numberIntWithIntValue:1];
    fix.isReadOnly = [XMSNumberInt numberIntWithIntValue:0];
    fix.optional = @"";
    fix.order = [XMSNumberInt numberIntWithIntValue:2];
    fix.regx = @"";
    fix.status = nil;
    fix.optIsVisible = [XMSNumberInt numberIntWithIntValue:1];
    fix.viewIsVisible = [XMSNumberInt numberIntWithIntValue:1];
    return fix;
}


-(FieldDescript*)longitude
{
    FieldDescript *fix = [FieldDescript new];
    fix.controlType = [XMSNumberInt numberIntWithIntValue:DynamicFieldControlTypeText];
    fix.entityRegID = @"";
    fix.expandFieldID = @"";
    fix.fieldLabel = @"经度";
    fix.fieldLength = [XMSNumberInt numberIntWithIntValue:13];
    fix.fieldName = @"Longitude";
    fix.fieldType = [XMSNumberInt numberIntWithIntValue:DynamicFieldTypeSystem];
    fix.isAllowEmpty = [XMSNumberInt numberIntWithIntValue:1];
    fix.isReadOnly = [XMSNumberInt numberIntWithIntValue:0];
    fix.optional = @"";
    fix.order = [XMSNumberInt numberIntWithIntValue:3];
    fix.regx = @"";
    fix.status = nil;
    fix.optIsVisible = [XMSNumberInt numberIntWithIntValue:1];
    fix.viewIsVisible = [XMSNumberInt numberIntWithIntValue:1];
    return fix;
}

-(FieldDescript*)latitude
{
    FieldDescript *fix = [FieldDescript new];
    fix.controlType = [XMSNumberInt numberIntWithIntValue:DynamicFieldControlTypeText];
    fix.entityRegID = @"";
    fix.expandFieldID = @"";
    fix.fieldLabel = @"纬度";
    fix.fieldLength = [XMSNumberInt numberIntWithIntValue:13];
    fix.fieldName = @"Latitude";
    fix.fieldType = [XMSNumberInt numberIntWithIntValue:DynamicFieldTypeSystem];
    fix.isAllowEmpty = [XMSNumberInt numberIntWithIntValue:1];
    fix.isReadOnly = [XMSNumberInt numberIntWithIntValue:0];
    fix.optional = @"";
    fix.order = [XMSNumberInt numberIntWithIntValue:4];
    fix.regx = @"";
    fix.status = nil;
    fix.optIsVisible = [XMSNumberInt numberIntWithIntValue:1];
    fix.viewIsVisible = [XMSNumberInt numberIntWithIntValue:1];
    return fix;
}

-(FieldDescript*)images
{
    FieldDescript *fix = [FieldDescript new];
    fix.controlType = [XMSNumberInt numberIntWithIntValue:DynamicFieldControlTypeMixedPanel];
    fix.entityRegID = @"";
    fix.expandFieldID = @"";
    fix.fieldLabel = @"";
    fix.fieldLength = nil;
    fix.fieldName = @"Images";
    fix.fieldType = [XMSNumberInt numberIntWithIntValue:DynamicFieldTypeDefault];
    fix.isAllowEmpty = [XMSNumberInt numberIntWithIntValue:1];
    fix.isReadOnly = [XMSNumberInt numberIntWithIntValue:0];
    fix.optional = @"";
    fix.order = [XMSNumberInt numberIntWithIntValue:5];
    fix.regx = @"";
    fix.status = nil;
    fix.optIsVisible = [XMSNumberInt numberIntWithIntValue:1];
    fix.viewIsVisible = [XMSNumberInt numberIntWithIntValue:1];
    return fix;
}

@end
